package com.qwz.example;

/**
* @Description: 真正的读者
* @Package com.qwz.example.Reader
* @author Qiuwuzhi
* @date 2019/12/24 10:07
* @version V1.0
*/
public class Reader implements Observer {
    /**
     * 读者的姓名
     */
    private String name;

    public void update(Subject subject) {
        System.out.println(name+"收到报纸了，阅读，内容是=>"+((NewsPaper)subject).getContent());
    }
    //推模式
    public void update(String content) {
        System.out.println(name+"收到报纸了，阅读，内容是=>"+content);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
